﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zhang.Model
{

    public class ResponseMessage
    {
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 回调地址
        /// </summary>
        public string Redirect { get; set; }

        private string _Message;

        /// <summary>
        /// 提示信息
        /// </summary>
        public string Message
        {
            get
            {
                if (string.IsNullOrEmpty(_Message))
                {
                    if (Status == 200)
                    {
                        _Message = "操作成功";

                    }
                }

                return _Message;
            }
            set
            {
                _Message = value;

            }
        }

        /// <summary>
        /// 数据
        /// </summary>
        public object Data { get; set; }


        private bool? _Bol;
        /// <summary>
        /// 是否已处理
        /// </summary>

        public bool Bol
        {
            get
            {

                if (_Bol == null)
                {

                    _Bol = Status == 200;
                }

                return _Bol.Value;

            }
            set
            {

                _Bol = value;

            }
        }


    }
}
